﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Proyectos.aspx.cs" Inherits="Proyectos" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 460px;
        }
        .style9
        {
            width: 182px;
        }
        .style11
        {
            width: 93px;
        }
        .style12
        {
            width: 80px;
        }
        .style14
        {
            width: 138px;
        }
        .style16
        {
            width: 333px;
        }
        .style17
        {
            width: 106px;
        }
        .style18
        {
            width: 72px;
        }
        .style20
        {
            text-align: center;
        }
        .style21
        {
            color: #003399;
        }
        .style22
        {
            width: 336px;
        }
        .style23
        {
            width: 81px;
        }
        .style24
        {
            width: 175px;
        }
        .style25
        {
            width: 143px;
        }
        .style26
        {
            width: 84px;
        }
        .style27
        {
            width: 213px;
        }
        .style28
        {
            width: 97px;
        }
        .style29
        {
            width: 481px;
        }
        .style30
        {
            width: 73px;
        }
    </style>
  <%--  <script src="Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script language="javascript">
        $(function () {

            $("#btnguardar").click(function () {

                $("#dgvper tbody tr").each(function (index) {
                    var campo1, campo2, campo3;
                    $(this).children("td").each(function (index2) {
                        switch (index2) {
                            case 0:
                                campo1 = $(this).text();
                                break;
                            case 1:
                                campo2 = $(this).text();
                                break;
                            case 2:
                                campo3 = $(this).text();
                                break;
                        }
//                         public int cod_det { get; set; }
//                        [DataMember]
//                        public int cod_pro { get; set; }
//                        [DataMember]
//                        public int cod_cli { get; set; }
//                        [DataMember]
//                        public int cod_per { get; set; }
//                        [DataMember]
//                        public int cod_gra { get; set; }
//                        [DataMember]
//                        public int can_det { get; set; }
                         json = "{'Nombre':'" + escape($('#txtNombre').val()) + "','Clave':'" + $('#txtPassword').val() + "','Estado':'" + estado + "'}";

                        //json = "{'Nombre':'" + escape($('#txtNombre').val()) + "','Clave':'" + $('#txtPassword').val() + "','Estado':'" + estado + "'}";

                        // var json = "";

                        var to = "CreateLogin.aspx/Save";
                        var options = {
                            type: "POST",
                            url: to,
                            data: json,
                            contentType: "application/json;charset=utf-8",
                            dataType: "json",
                            async: false,
                            success: function (response) {
                                //alert("success: " + response);
                                //alert(response.d);
                                rpta = response.d;
                            },
                            error: function (msg) { alert(msg); }
                        };

                        if (rpta > 0) {
                            alert('Se realizó correctamente la operacion, [Crear Proyecto] !!!');
                        }
                        //                $(this).css("background-color", "#ECF8E0");
                    })
                    alert(campo1 + ' - ' + campo2 + ' - ' + campo3);
                })
            })
        })
  </script>--%>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <div class="style20">
            <br />
            <br />
            <br />
            <span class="style21"><strong>CREACION&nbsp; PROYECTOS</strong></span><br />
            <br />
            <br />
        </div>
        <table class="style1">
            <tr>
                <td class="style30">
                    <asp:Label ID="Label1" runat="server" Text="Nombre"></asp:Label>
                </td>
                <td class="style16">
                    <asp:TextBox ID="txtnom" runat="server" Width="276px"></asp:TextBox>
                </td>
                <td class="style17">
                    &nbsp;</td>
                <td class="style9">
                    &nbsp;</td>
                <td class="style14">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        &nbsp;Código&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txtcod" runat="server" Width="65px"></asp:TextBox>
&nbsp;&nbsp;
        <asp:Button ID="bus" runat="server" onclick="bus_Click" Text="Buscar" />
        <br />
        <table class="style1">
            <tr>
                <td class="style18">
                    <asp:Label ID="Label4" runat="server" Text="Cliente" 
                        ondatabinding="btnagr_Click"></asp:Label>
                </td>
                <td class="style22">
                    &nbsp;<asp:TextBox ID="txtcli" runat="server" Width="270px"></asp:TextBox>
&nbsp;&nbsp;
                </td>
                <td class="style11">
                    <asp:Label ID="Label5" runat="server" Text="Presupuesto"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtpre" runat="server"></asp:TextBox>
                </td>
            </tr>
        </table>
        <br />
        <table class="style1">
            <tr>
                <td class="style12">
                    <asp:Label ID="Label6" runat="server" Text="Descripción"></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="txtdes" runat="server" Height="38px" TextMode="MultiLine" 
                        Width="276px"></asp:TextBox>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <br />
        <asp:Button ID="btngenerar" runat="server"  
            Text="Generar Perfil y Grado" onclick="btngenerar_Click" />
        <br />
        <br />
        <table class="style1">
            <tr>
                <td class="style23">
                    <asp:Label ID="Label7" runat="server" Text="Perfil"></asp:Label>
                </td>
                <td class="style24">
                    <asp:DropDownList ID="cbper" runat="server" 
                        DataTextField="nom_per" DataValueField="cod_per" Height="16px" 
                        onselectedindexchanged="cbper_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td class="style25">
                    <asp:Label ID="Label8" runat="server" Text="Grado de Instrucción"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="cbgra" runat="server" 
                        DataTextField="nom_gra" DataValueField="cod_gra">
                    </asp:DropDownList>
                </td>
            </tr>
        </table>
        <br />
        <table class="style1">
            <tr>
                <td class="style26">
                    Cantidad</td>
                <td class="style27">
                    <asp:TextBox ID="txtcan" runat="server"></asp:TextBox>
                </td>
                <td class="style28">
                    <asp:Button ID="btnagr" runat="server" Text="Agregar" onclick="btnagr_Click" />
                </td>
                <td>
                    <asp:Button ID="btneli" runat="server" Text="Eliminar" onclick="Page_Load" />
                </td>
            </tr>
        </table>
        <br />
        <table class="style1">
            <tr>
                <td class="style29" rowspan="3">
                    <asp:GridView ID="dgvper" runat="server" 
                        Width="221px" AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="nom_per" FooterText="Perfil" HeaderText="Perfil" />
                            <asp:BoundField DataField="nom_gra" HeaderText="Grado" />
                            <asp:BoundField DataField="canti" HeaderText="Cantidad" SortExpression="canti">
                            <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundField>
                            <asp:BoundField DataField="cod_per" HeaderText="Codigo Perfil" />
                            <asp:BoundField DataField="cod_gra" HeaderText="Codigo Grado" />
                        </Columns>
                    </asp:GridView>
                </td>
                <td>
                   <asp:Button ID="btnguardar" runat="server" Text="Guardar" Width="77px" onclick="btnguardar_Click"   
                         />
                   <%-- <input id="btnguardar" type="button" value="Guardar" />--%>
                    </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btncan" runat="server" Text="Cancelar" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnsal" runat="server" Text="Salir" Width="76px" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <br />
    
    </div>
    </form>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
</body>
</html>
